package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbTypeTemplateMapper;
import com.dongdongshop.pojo.TbTypeTemplate;
import com.dongdongshop.service.TbTypeTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
@com.alibaba.dubbo.config.annotation.Service
public class TbTypeTemplateServiceImpl implements TbTypeTemplateService {

    @Autowired
    private TbTypeTemplateMapper tbTypeTemplateMapper;

    @Override
    public List<TbTypeTemplate> listTemplate() {

        return tbTypeTemplateMapper.selectByExample(null);
    }

    @Override
    public Boolean insert(TbTypeTemplate tbTypeTemplate) {
        int i = tbTypeTemplateMapper.insertSelective(tbTypeTemplate);
        return i>0;
    }

    @Override
    public Boolean delete(Long id) {
        int i = tbTypeTemplateMapper.deleteByPrimaryKey(id);
        return i>0;
    }

    @Override
    public TbTypeTemplate selectById(Long id) {
        TbTypeTemplate tbTypeTemplate = tbTypeTemplateMapper.selectByPrimaryKey(id);
        return tbTypeTemplate;
    }

    @Override
    public Boolean updata(TbTypeTemplate tbTypeTemplate) {
        int i = tbTypeTemplateMapper.updateByPrimaryKeySelective(tbTypeTemplate);
        return i>0;
    }
}
